<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="include :: header">
    <style>
        .input-group {
            margin-bottom: 10px;
        }

        .input-box {
            width: 45%;
            display: inline-block;
            margin-right: 5px;
        }

        .remove-btn {
            width: 10%;
            display: inline-block;
        }
    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <div class="form-horizontal m-t">
                        <div class="form-group">
                            <label class="col-sm-3 control-label"><span style="color: red">*</span>审核状态：</label>
                            <div class="col-sm-8">
                                <select class="form-control valid" name="status" id="status">
                                    <option value="">请选择</option>
                                    <option value="1">审核通过</option>
                                    <option value="2">审核拒绝</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label"><span style="color: red">*</span>快递名称:</label>
                            <div class="col-sm-8">
                                <input id="trackingName" name="trackingName" placeholder="请输入快递名称"
                                       class="form-control"
                                       type="text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label"><span style="color: red">*</span>快递单号:</label>
                            <div class="col-sm-8">
                                <input id="trackingNumber" name="trackingNumber" placeholder="请输入快递单号"
                                       class="form-control"
                                       type="text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">备注:</label>
                            <div class="col-sm-8">
                                <input id="remark" name="remark" placeholder="请输入备注"
                                       class="form-control"
                                       type="text">
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3" style="display: flex;justify-content: space-evenly;">
                                <button style="width: 150px;margin-left: -68px;" class="btn btn-primary" onclick="handleExamineSubmit()"
                                        id="getValues">提交
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div th:include="include::footer"></div>
<script src="//s.xlongwei.com/res/js/My97DatePicker/WdatePicker.js"></script>
<!--	<script type="text/javascript" src="/js/webJs/jzweb/order/edit.js">-->
<script>
    var dataList = JSON.parse(sessionStorage.getItem('order_shenhe'))
    function handleExamineSubmit(){

        // 显示收集到的对象数组
        // $('#output').text(JSON.stringify(values, null, 2));
        if (!$('#status').val()) {
            layer.msg("请选择审核状态");
            return false;
        }
        if (!$('#trackingName').val()) {
            layer.msg("请输入快递名称");
            return false;
        }
        if (!$('#trackingNumber').val()) {
            layer.msg("请输入快递单号");
            return false;
        }
        $.ajax({
            cache: true,
            type: "POST",
            url: '/jzweb/orderSpecs/update',
            data: JSON.stringify({
                orderType:1,
                id: dataList.id,
                status:$('#status').val(),
                trackingName:$('#trackingName').val(),
                trackingNumber:$('#trackingNumber').val(),
                remark:$('#remark').val(),
            }),// 你的formid
            contentType: "application/json",
            async: false,
            error: function (request) {
                parent.layer.alert("Connection error");
            },
            success: function (data) {
                if (data.code == 0) {
                    parent.layer.msg("操作成功");
                    parent.reLoad();
                    var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
                    parent.layer.close(index);
                } else {
                    parent.layer.alert(data.msg);

                }
            }
        });

    }
</script>
</body>
</html>
